package com.lc.tgxm.activity;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.WindowManager;

import com.lc.tgxm.R;
import com.lc.tgxm.util.GLobalConstant;

/**
 * WelcomeActivity
 * Created by Lei on 2016/8/26.
 */
public class WelcomeActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);

        new Handler(new Handler.Callback() {
            @Override
            public boolean handleMessage(Message msg) {
//                if (!BaseApplication.basePreferences.readIsGuide()) {
//                    startVerifyActivity(GuideActivity.class);
//                } else
                    // TODO 测试时前面取非，正式项目时请去掉非号
                    if (!TextUtils.equals(getUserId(), GLobalConstant.USERID)) {
                        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
                        startVerifyActivity(LoginActivity.class);
                    } else {
                        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
                        startVerifyActivity(MainNavigationActivity.class);
                    }
                finish();
                return false;
            }
        }).sendEmptyMessageDelayed(0, GLobalConstant.WELTIME);

    }

    @Override
    public void onBackPressed() {
    }

}